import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;


public class WinScreen extends JPopupMenu{
	private static final long serialVersionUID = 1L;
	
	String name1 = "Player 1";
	String name2 = "Player 2";
	String name3 = "Player 3";
	String name4 = "Player 4";
	String name5 = "Player 5";
	String name6 = "Player 6";

	WinScreen(){
		
		//Player names
		JLabel player1name = new JLabel(name1);
		JLabel player2name = new JLabel(name2);
		JLabel player3name = new JLabel(name3);
		JLabel player4name = new JLabel(name4);
		JLabel player5name = new JLabel(name5);
		JLabel player6name = new JLabel(name6);
		
		//Panel for each player
		JPanel Player1 = new JPanel();
		JPanel Player2 = new JPanel();
		JPanel Player3 = new JPanel();
		JPanel Player4 = new JPanel();
		JPanel Player5 = new JPanel();
		JPanel Player6 = new JPanel();
		
		Player1.setLayout(new GridLayout());
		Player2.setLayout(new GridLayout());
		Player3.setLayout(new GridLayout());
		Player4.setLayout(new GridLayout());
		Player5.setLayout(new GridLayout());
		Player6.setLayout(new GridLayout());
		
		//Panel for each card of each player
		JPanel p1c1 = new JPanel();
		JPanel p1c2 = new JPanel();
		JPanel p1c3 = new JPanel();
		JPanel p1c4 = new JPanel();
		JPanel p1c5 = new JPanel();
		JPanel p1c6 = new JPanel();
		
		p1c1.setLayout(new GridLayout());
		p1c2.setLayout(new GridLayout());
		p1c3.setLayout(new GridLayout());
		p1c4.setLayout(new GridLayout());
		p1c5.setLayout(new GridLayout());
		p1c6.setLayout(new GridLayout());
		
		JPanel p2c1 = new JPanel();
		JPanel p2c2 = new JPanel();
		JPanel p2c3 = new JPanel();
		JPanel p2c4 = new JPanel();
		JPanel p2c5 = new JPanel();
		JPanel p2c6 = new JPanel();
		
		p2c1.setLayout(new GridLayout());
		p2c2.setLayout(new GridLayout());
		p2c3.setLayout(new GridLayout());
		p2c4.setLayout(new GridLayout());
		p2c5.setLayout(new GridLayout());
		p2c6.setLayout(new GridLayout());
		
		JPanel p3c1 = new JPanel();
		JPanel p3c2 = new JPanel();
		JPanel p3c3 = new JPanel();
		JPanel p3c4 = new JPanel();
		JPanel p3c5 = new JPanel();
		JPanel p3c6 = new JPanel();
		
		p3c1.setLayout(new GridLayout());
		p3c2.setLayout(new GridLayout());
		p3c3.setLayout(new GridLayout());
		p3c4.setLayout(new GridLayout());
		p3c5.setLayout(new GridLayout());
		p3c6.setLayout(new GridLayout());
		
		JPanel p4c1 = new JPanel();
		JPanel p4c2 = new JPanel();
		JPanel p4c3 = new JPanel();
		JPanel p4c4 = new JPanel();
		JPanel p4c5 = new JPanel();
		JPanel p4c6 = new JPanel();
		
		p4c1.setLayout(new GridLayout());
		p4c2.setLayout(new GridLayout());
		p4c3.setLayout(new GridLayout());
		p4c4.setLayout(new GridLayout());
		p4c5.setLayout(new GridLayout());
		p4c6.setLayout(new GridLayout());
		
		JPanel p5c1 = new JPanel();
		JPanel p5c2 = new JPanel();
		JPanel p5c3 = new JPanel();
		JPanel p5c4 = new JPanel();
		JPanel p5c5 = new JPanel();
		JPanel p5c6 = new JPanel();
		
		p5c1.setLayout(new GridLayout());
		p5c2.setLayout(new GridLayout());
		p5c3.setLayout(new GridLayout());
		p5c4.setLayout(new GridLayout());
		p5c5.setLayout(new GridLayout());
		p5c6.setLayout(new GridLayout());
		
		JPanel p6c1 = new JPanel();
		JPanel p6c2 = new JPanel();
		JPanel p6c3 = new JPanel();
		JPanel p6c4 = new JPanel();
		JPanel p6c5 = new JPanel();
		JPanel p6c6 = new JPanel();
		
		p6c1.setLayout(new GridLayout());
		p6c2.setLayout(new GridLayout());
		p6c3.setLayout(new GridLayout());
		p6c4.setLayout(new GridLayout());
		p6c5.setLayout(new GridLayout());
		p6c6.setLayout(new GridLayout());
		
		//Labels for the suit and number for each card
		JLabel p1c1num = new JLabel();
		JLabel p1c1suit = new JLabel();
		JLabel p1c2num = new JLabel();
		JLabel p1c2suit = new JLabel();
		JLabel p1c3num = new JLabel();
		JLabel p1c3suit = new JLabel();
		JLabel p1c4num = new JLabel();
		JLabel p1c4suit = new JLabel();
		JLabel p1c5num = new JLabel();
		JLabel p1c5suit = new JLabel();
		
		JLabel p2c1num = new JLabel();
		JLabel p2c1suit = new JLabel();
		JLabel p2c2num = new JLabel();
		JLabel p2c2suit = new JLabel();
		JLabel p2c3num = new JLabel();
		JLabel p2c3suit = new JLabel();
		JLabel p2c4num = new JLabel();
		JLabel p2c4suit = new JLabel();
		JLabel p2c5num = new JLabel();
		JLabel p2c5suit = new JLabel();
		
		JLabel p3c1num = new JLabel();
		JLabel p3c1suit = new JLabel();
		JLabel p3c2num = new JLabel();
		JLabel p3c2suit = new JLabel();
		JLabel p3c3num = new JLabel();
		JLabel p3c3suit = new JLabel();
		JLabel p3c4num = new JLabel();
		JLabel p3c4suit = new JLabel();
		JLabel p3c5num = new JLabel();
		JLabel p3c5suit = new JLabel();

		JLabel p4c1num = new JLabel();
		JLabel p4c1suit = new JLabel();
		JLabel p4c2num = new JLabel();
		JLabel p4c2suit = new JLabel();
		JLabel p4c3num = new JLabel();
		JLabel p4c3suit = new JLabel();
		JLabel p4c4num = new JLabel();
		JLabel p4c4suit = new JLabel();
		JLabel p4c5num = new JLabel();
		JLabel p4c5suit = new JLabel();

		JLabel p5c1num = new JLabel();
		JLabel p5c1suit = new JLabel();
		JLabel p5c2num = new JLabel();
		JLabel p5c2suit = new JLabel();
		JLabel p5c3num = new JLabel();
		JLabel p5c3suit = new JLabel();
		JLabel p5c4num = new JLabel();
		JLabel p5c4suit = new JLabel();
		JLabel p5c5num = new JLabel();
		JLabel p5c5suit = new JLabel();

		JLabel p6c1num = new JLabel();
		JLabel p6c1suit = new JLabel();
		JLabel p6c2num = new JLabel();
		JLabel p6c2suit = new JLabel();
		JLabel p6c3num = new JLabel();
		JLabel p6c3suit = new JLabel();
		JLabel p6c4num = new JLabel();
		JLabel p6c4suit = new JLabel();
		JLabel p6c5num = new JLabel();
		JLabel p6c5suit = new JLabel();
		
		p1c1.add(p1c1num);
		p1c1.add(p1c1suit);
		p1c2.add(p1c2num);
		p1c2.add(p1c2suit);
		p1c3.add(p1c3num);
		p1c3.add(p1c3suit);
		p1c4.add(p1c4num);
		p1c4.add(p1c4suit);
		p1c5.add(p1c5num);
		p1c5.add(p1c5suit);
	
		p2c1.add(p2c1num);
		p2c1.add(p2c1suit);
		p2c2.add(p2c2num);
		p2c2.add(p2c2suit);
		p2c3.add(p2c3num);
		p2c3.add(p2c3suit);
		p2c4.add(p2c4num);
		p2c4.add(p2c4suit);
		p2c5.add(p2c5num);
		p2c5.add(p2c5suit);
	
		p3c1.add(p3c1num);
		p3c1.add(p3c1suit);
		p3c2.add(p3c2num);
		p3c2.add(p3c2suit);
		p3c3.add(p3c3num);
		p3c3.add(p3c3suit);
		p3c4.add(p3c4num);
		p3c4.add(p3c4suit);
		p3c5.add(p3c5num);
		p3c5.add(p3c5suit);
		
		p4c1.add(p4c1num);
		p4c1.add(p4c1suit);
		p4c2.add(p4c2num);
		p4c2.add(p4c2suit);
		p4c3.add(p4c3num);
		p4c3.add(p4c3suit);
		p4c4.add(p4c4num);
		p4c4.add(p4c4suit);
		p4c5.add(p4c5num);
		p4c5.add(p4c5suit);
		
		p5c1.add(p5c1num);
		p5c1.add(p5c1suit);
		p5c2.add(p5c2num);
		p5c2.add(p5c2suit);
		p5c3.add(p5c3num);
		p5c3.add(p5c3suit);
		p5c4.add(p5c4num);
		p5c4.add(p5c4suit);
		p5c5.add(p5c5num);
		p5c5.add(p5c5suit);
	
		p6c1.add(p6c1num);
		p6c1.add(p6c1suit);
		p6c2.add(p6c2num);
		p6c2.add(p6c2suit);
		p6c3.add(p6c3num);
		p6c3.add(p6c3suit);
		p6c4.add(p6c4num);
		p6c4.add(p6c4suit);
		p6c5.add(p6c5num);
		p6c5.add(p6c5suit);
		
		Player1.add(p1c1);
		Player1.add(p1c2);
		Player1.add(p1c3);
		Player1.add(p1c4);
		Player1.add(p1c5);
	
		Player2.add(p2c1);
		Player2.add(p2c2);
		Player2.add(p2c3);
		Player2.add(p2c4);
		Player2.add(p2c5);
		
		Player3.add(p3c1);
		Player3.add(p3c2);
		Player3.add(p3c3);
		Player3.add(p3c4);
		Player3.add(p3c5);
		
		Player4.add(p4c1);
		Player4.add(p4c2);
		Player4.add(p4c3);
		Player4.add(p4c4);
		Player4.add(p4c5);
		
		Player5.add(p5c1);
		Player5.add(p5c2);
		Player5.add(p5c3);
		Player5.add(p5c4);
		Player5.add(p5c5);
	
		Player6.add(p6c1);
		Player6.add(p6c2);
		Player6.add(p6c3);
		Player6.add(p6c4);
		Player6.add(p6c5);
	
		JButton ok = new JButton("OK");
		ok.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				setVisible(false);
			}
		});
		
		//panel properties, added components and setting bounds
		setLayout(null);
		setBackground(Color.green);
		setPreferredSize(new Dimension(400,600));
		setLocation(400,300);
		
		add(player1name);
		add(player2name);
		add(player3name);
		add(player4name);
		add(player5name);
		add(player6name);
		
		add(Player1);
		add(Player2);
		add(Player3);
		add(Player4);
		add(Player5);
		add(Player6);
		
		add(ok);
		
		ok.setBounds(175,540,75,25);
		
		player1name.setBounds(15,23,50,25);
		player2name.setBounds(15,100,50,25);
		player3name.setBounds(15,175,50,25);
		player4name.setBounds(15,250,50,25);
		player5name.setBounds(15,325,50,25);
		player6name.setBounds(15,400,50,25);
		
		Player1.setBounds(15,45,370,50);
		Player2.setBounds(15,120,370,50);
		Player3.setBounds(15,195,370,50);
		Player4.setBounds(15,270,370,50);
		Player5.setBounds(15,345,370,50);
		Player6.setBounds(15,420,370,50);
	}

}
